/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86183
 * Date: 2022-10-14
 * Time: 8:11
 */
class Student{
    private String name;
    private int age;
    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }
    public String getName() {
        return name;
    }
    public int getAge() {
        return age;
    }
    public void show(){
        System.out.println("我是"+this.name+",年龄"+this.age);
    }
}
class Undergrduate extends Student{
    private String degree;
    public Undergrduate(String name, int age, String degree) {
        super(name, age);
        this.degree = degree;
    }
    public void show(){
        System.out.println("我是"+super.getName()+",年龄"+super.getAge()+",学位是"+this.degree);
    }
}

public class Test {
    public static void main(String[] args) {
        Student s1 = new Student("王雅钊",19);
        s1.show();
        Undergrduate s2 = new Undergrduate("王雅钊",19,"本科");
        s2.show();
    }
//    /**
//     * 在x,y坐标轴中，长度范围：startX -- startX+getLength();
//     * 宽度的范围：h -- startY;
//     * @param x
//     * @param y
//     * @return
//     */
//    public boolean islnside(double x,double y){
//        double h = 0;
//        double l = startX+getLength();
//        if(getStartY() == getWidth()){//当width == startY,时h = 0;
//            h = 0;
//        }else if(getStartY() >  getWidth() ){//width < startY,在y轴的正半轴， h = width
//            h = getWidth();
//        }else {                           //width >startY,在y轴的负半轴，h = startY - width;
//            h = getStartY() - getWidth();
//        }
//        return x > startX&& x<l && y> h && y<getStartY();
//    }
}
